package com.example.a12769.myapplication.home

import android.content.Context
import android.os.Parcel
import android.os.Parcelable
import android.view.View
import com.example.a12769.myapplication.R
import com.example.a12769.myapplication.base.adapter.BaseRVAdapter
import com.example.a12769.myapplication.base.adapter.RVViewHolder
import java.util.*


class ReadFragmentAdapter(mList: List<Objects>, resLayout: Int, mContext: Context) : BaseRVAdapter<Objects>(mList, resLayout, mContext), View.OnClickListener {
    override fun bindData(viewHolder: RVViewHolder, bean: Objects) {
        var haha = bean as ReadBean
         val bean1 = haha.name
         viewHolder.setText(R.id.home_item_tv, "10元")
         viewHolder.setText(R.id.home_item_centtv_tv,"-13.04%")
        // viewHolder.setImageUrl(R.id.read_iv_item_photo, "http://39.105.89.144:8080" + bean1.getTasIco())
    }

    override fun bindAction(viewHolder: RVViewHolder, bean: Objects) {
        // viewHolder.setOnClickListener(R.id.read_ry_item_pl, bean, this)
    }

    override fun onClick(v: View) {
        /* val bean = v.tag as ReadTaskBean.RESOBJBean
         when (v.id) {
             R.id.read_ry_item_pl -> {
                 mContext.startActivity(Intent(mContext, WebViewActivity::class.java).putExtra("img_url", "http://39.105.89.144:8080" + bean.getTasIco()).putExtra("button", "1").putExtra("title", bean.getTasTitle()).putExtra("price", bean.getTasPrice()).putExtra("tasId", bean.getTasId()))
                 RxBus.getInstance().post("http://39.105.89.144:8080" + bean.getTasIco())
             }
         }*/
    }

}

